package com.tanhua.manager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.manager.domain.Log;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface LogMapper extends BaseMapper<Log> {

    //统计次日留存率，昨日注册，今日登录
    @Select("select count(distinct user_id) from tb_log where log_time = #{today} " +
            " and user_id in (select tl.user_id from tb_log tl where tl.type = '0102' and tl.log_time = #{yesterday}) ")
    Integer selectRetentionCount(@Param("today")String today, @Param("yesterday")String yesterday);
}
